/*
    * Author:   Sander
    * Date:     13-mei-2011
    * Name:     ASCIILoader
    * Version:  1.0
    *
    * This code is property of Sander blahblahblah copyright blahblah.
*/


package javaraytracer.parsers;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;

//PENDING:add function/property description
public class ASCIILoader
{

	public static String[] load(String filename) throws FileNotFoundException
	{
		StringBuilder obj = new StringBuilder();
		String NL = System.getProperty("line.separator");
		Scanner scanner = new Scanner(new FileInputStream(filename), "UTF-8");

		while(scanner.hasNextLine())
		{
			String in = scanner.nextLine();
			if(!in.isEmpty())
			{
				obj.append(in);
				obj.append(NL);
			}
		}
		String[] lines = obj.toString().split(NL);
		scanner.close();
		return lines;
	}
}
